package com.lhf.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lhf.dao.PersonDao;
import com.lhf.entity.Person;
import com.lhf.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service("service")
public class PersonServiceImpl implements PersonService {
    @Resource
    private PersonDao dao;
    @Override
    public PageInfo<Person> getPerson(String name, String sex, Integer pageindex) {
        PageHelper.startPage(pageindex,2);
        List<Person> list = dao.getPerson(name, sex);
        PageInfo<Person> pages=new PageInfo<>(list);
        return pages;
    }

    @Override
    public String getxx(int id) {
        return dao.getxx(id);
    }

    public PersonDao getDao() {
        return dao;
    }

    public void setDao(PersonDao dao) {
        this.dao = dao;
    }
}
